import { http } from '@/api';
import { PORT1 } from '@/api/config/port';
import { ResultData } from '@/api/interface/index';
import {
  entityProfilesCreate,
  entityProfilesSearch,
} from '../interface/entityProfiles';

// 创建
export const Create = (params: entityProfilesCreate) => {
  return http.post<ResultData>(PORT1 + `/admin/compliance/create`, params);
};

export const Update = (params: entityProfilesCreate) => {
  return http.post<ResultData>(PORT1 + `/admin/compliance/update`, params);
};

// 创建
export const Active = (params: { id: string | unknown; active: boolean }) => {
  return http.post<ResultData>(PORT1 + `/admin/compliance/active`, params, {
    loading: true,
  });
};

// 发送link
export const Resend = (id: unknown) => {
  return http.post<ResultData>(
    PORT1 + `/admin/compliance/resend?id=` + id,
    {},
    { loading: true }
  );
};

// 查询列表
export const Search = (params: entityProfilesSearch) => {
  return http.post<any>(PORT1 + `/admin/compliance/search`, params);
};

// 导出列表
export const Export = (params: any) => {
  return http.download(PORT1 + `/admin/compliance/export`, params, {
    loading: true,
  });
};

// 导出列表
export const LoginLogs = (params: any) => {
  return http.post<any>(PORT1 + `/admin/compliance/login-logs`, params);
};
